<div id="city-line" style=" height: 100%;width: 100%;"></div>
<script type="text/javascript">
    $(function () {
        $.ajax({
            url: "#springUrl('/network/city/work/bar1')",
            data: {"batchId": "$!{batchId}"},
            type: "POST",
            success: function (text) {
                var d = JSON.parse(text);
                if (d.success && d.data) {
                    var myChart = echarts.init(document.getElementById('city-line'), 'macarons');
                    var option = {
                        title: {
                            text: 'Beijing AQI',
                            show: false
                        },
                        tooltip: {
                            trigger: 'axis'
                        },
                        legend: {
                          //  data: ['回收作业人数','配送作业人数']
                        },
                        xAxis: {
                            data: d.data.x,
                            boundaryGap: true,
                            axisLabel:{
                                show:true,
                                textStyle:{
                                    color:"#595959"
                                }
                            },
                            axisLine: {
                                show: false
                            },
                            axisTick: {
                                show: false
                            },
                        },
                        yAxis: {
                            splitLine: {
                                show: false
                            },
                            axisLine: {
                                show: false
                            },
                            axisTick: {
                                show: false
                            },
                            axisLabel: {
                                formatter: function(value){
                                    var var1=value*1;
                                    return var1;
                                },
                                textStyle:{
                                    color:"#595959"
                                }
                            },
                            splitLine:{
                                show:true
                            },
                            splitArea: {
                                show: true,
                                areaStyle: {
                                    color: ['rgba(0,0,0,0)', 'rgba(0,0,0,0)']
                                }
                            },
                        },
                        toolbox: {

                        },
                        dataZoom: [{
                            startValue: '5:00'
                        }, {
                            type: 'inside'
                        }],
                        series: [
                                {
                                    name: '回收作业人数',
                                    type: 'line',
                                    data: d.data.s1,
                                    itemStyle: {
                                        normal: {
                                            color: '#4472c4'
                                        }
                                    },
                                    areaStyle: {
                                        normal: {
                                            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                                offset: 0,
                                                color: '#4472c4'
                                            }, {
                                                offset: 1,
                                                color: '#4472c4'
                                            }])
                                        }
                                    },
                                },
                                {
                                    name: '配送作业人数',
                                    type: 'line',
                                    data: d.data.s2,
                                    itemStyle: {
                                        normal: {
                                            color: '#0fa99d'
                                        }
                                    },
                                    areaStyle: {
                                        normal: {
                                            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                                offset: 0,
                                                color: '#0fa99d'
                                            }, {
                                                offset: 1,
                                                color: '#0fa99d'
                                            }])
                                        }
                                    },
                                }
                            ]

                    };
                    myChart.setOption(option);
                }else{
                    var div1="<div type='text' style='padding-top:15%' class=' text-center  '>查询数据异常</div>"
                    $("#city-line").prepend(div1);
                }
            }
        })
    });
</script>
